#include<stdio.h>

int main()
{
  //FILE *fp = fopen("./log.txt","w");
  //FILE *fp = fopen("./log.txt","r");
  FILE *fp = fopen("./log.txt","a");//追加写,append
  if(NULL == fp){
    perror("fopen");
    return 1;
  }

 // char buffer[64];
 // while(fgets(buffer,sizeof(buffer),fp)){
 //   printf("%s\n",buffer);
 // }

 // if(!feof(fp)){
 //   printf("error\n");
 // }
   
   
  const char *msg = "hello bit\n";
  int cnt = 10;
  while(cnt--){
    fputs(msg,fp);
  }
 
  fclose(fp);
}
